package palidino76.rs2.io.packets;

import palidino76.rs2.*;
import palidino76.rs2.Server;
import palidino76.rs2.npcs.*;
import palidino76.rs2.player.skills.FishingProtocol;
import palidino76.rs2.player.games.*;
import palidino76.rs2.player.combat.*;
import palidino76.rs2.player.Player;
import palidino76.rs2.util.Misc;
import palidino76.rs2.npcs.*;

public class NPCOption1 implements Packet {
    /**
     * Handles the first NPC option.
     * @param p The Player which the frame should be handled for.
     * @param packetId The packet id this belongs to.
     * @param packetSize The amount of bytes being recieved for this packet.
     */
    public void handlePacket(Player p, int packetId, int packetSize) {
        if (p == null || p.stream == null) {
            return;
        }
        int npcId = p.stream.readUnsignedWordA();
        p.clickId = npcId;
        p.clickX = Server.engine.npcs[npcId].absX;
        p.clickY = Server.engine.npcs[npcId].absY;
	p.requestFaceTo(p.clickId);
	NPC n = Engine.npcs[p.clickId];
	int k = p.skillLvl[10];

	switch (n.npcType) {
		case 522:
			p.NpcWanneTalk = 1;
			p.NpcDialogueSend = false;
			break;

		case 2258:
			//p.teleportTo(3040, 4835, 0, 0, 0, 8939, 8941, 1576, 0, 1577, 0);
			p.frames.showInterface(p, 619);
			p.frames.setString(p, "Teleport to which altar...", 619, 43);
		break;
		
		case 1526:
			p.NpcWanneTalk = 1526;
			p.NpcDialogueSend = false;
			break;
		case 251:
			p.NpcWanneTalk = 251;
			p.NpcDialogueSend = false;
			break;

		case 1304:
			p.NpcWanneTalk = 1304;
			p.NpcDialogueSend = false;
			break;

		case 1918:
			p.NpcWanneTalk = 1918;
			p.NpcDialogueSend = false;
			break;
		case 6538:
			p.NpcWanneTalk = 6538;
			p.NpcDialogueSend = false;
			break;

		case 2237:
			p.NpcWanneTalk = 2237;
			p.NpcDialogueSend = false;
			break;

		case 1:
			p.NpcWanneTalk = 1;
			p.NpcDialogueSend = false;
			break;

		case 2:
			p.NpcWanneTalk = 2;
			p.NpcDialogueSend = false;
			break;

		case 3:
			p.NpcWanneTalk = 3;
			p.NpcDialogueSend = false;
			break;

		case 4:
			p.NpcWanneTalk = 4;
			p.NpcDialogueSend = false;
			break;

		case 5:
			p.NpcWanneTalk = 5;
			p.NpcDialogueSend = false;
			break;

		case 0:
			p.NpcWanneTalk = 10;
			p.NpcDialogueSend = false;
			break;

		case 2244:
			p.NpcWanneTalk = 2244;
			p.NpcDialogueSend = false;
			break;

		case 519:
			p.NpcWanneTalk = 519;
			p.NpcDialogueSend = false;
			break;
		
		case 1597:
			p.NpcWanneTalk = 1597;
			p.NpcDialogueSend = false;
			break;
		
		case 5478:
			p.NpcWanneTalk = 5478;
			p.NpcDialogueSend = false;
			break;

		case 961:
			p.NpcWanneTalk = 961;
			p.NpcDialogueSend = false;
			break;
			
		case 1696:
			p.NpcWanneTalk = 1696;
			p.NpcDialogueSend = false;
			break;

		case 316: // Fish Shrimps
			p.NpcWanneTalk = 316;
			p.NpcDialogueSend = false;
			break;

		case 313: // Fish Bass
			p.NpcWanneTalk = 313;
			p.NpcDialogueSend = false;
			break;


		case 312: // Fish Lobsters
			p.NpcWanneTalk = 312;
			p.NpcDialogueSend = false;
			break;

	}
	System.out.println("Unhandled npc option 1 : "+n.npcType+" <- id.");
    }
}
